<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>手动开闸</title>
    <style>
        *{
            box-sizing: border-box;
            
        }
        a{
            color: white;
            text-decoration: none;
        }
        body{
            margin: 0;
        }
        .home-content{
            width: 100%;
            height: 100vh;
            text-align: center;
        }
        .home-content h1{
            color: white;
            font-size: 12vw;
            background-color: rgb(0, 102, 255);
            padding: 5vw 0;
            margin: 0 0 6vw 0;
        }
        .home-content div{
            width: 80%;
            height: 20vw;
            background-color: rgb(0, 102, 255);
            border-radius: 3px;
            text-align: center;
            margin: 3vw auto;
            line-height: 20vw;
            color: white;
            font-size: 9vw;
        }
    </style>
</head>
<body>
    <div class="home-content" >
        <h1>手动开闸</h1>
        {foreach $systemlist as $list}
            <div class="openTheDoor">{$list.system_name}</div>
        {/foreach}
		<input type="hidden" value="{$system}" id='hid'>
    </div>
<script src="static/admin/js/jquery.js"></script>
<script>
    $(".openTheDoor").on("click",(e)=>{
        var system_name = e.currentTarget.textContent
		 var sys = $("#hid").val()
		 if (sys == 1){
				window.location.href = "{:url('admin/Order/openReason')}?system_name="+system_name;
		}else{
		        var url = '{:url("admin/Order/manualOpen")}'
				$.get(url, {system_name: system_name,sys:sys}, function(r){
					if (r.success) {
						alert(r.success)
						location.reload()
					}else{
						alert(r.error)
						location.reload()
					}
				})
		
		}
    })
</script>
</body>
</html>